package com.qding.park.common.core.exceptions;

/**
 * @ClassName ExceptionMessage
 * @Description TODO(表示异常上抛的上下文消息实体对象的实例，它记录了异常在“封装上抛”传播路径中的每一层异常信息)
 * @author Administrator
 * @Date 2016年8月28日 下午9:15:15
 * @version 1.0.0
 */
public class ExceptionMessage {
	
	
	/**
	 * @Field @name : TODO(异常名称)
	 */
	private String name;
	
	/**
	 * @Field @log : TODO(是否记录日志)
	 */
	private boolean log;
	
	/**
	 * @Field @simpleText : TODO(简单描述)
	 */
	private String simpleText;
	
	/**
	 * @Field @detailText : TODO(详细描述)
	 */
	private String detailText;
	
	public static ExceptionMessage createExceptionMessage(String name,String simpleText,String detailText){
		return new ExceptionMessage(name,simpleText,detailText);
	}
	
	
	public void appendDetailText(String text){
//		StringBuilder temp=new StringBuilder();
		detailText=detailText+"||\n"+text;
		
	}
	public ExceptionMessage(String name,String simpleText,String detailText){
		
		this.name=name;
		this.simpleText=simpleText;
		this.detailText=detailText;
	}
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isLog() {
		return log;
	}

	public void setLog(boolean log) {
		this.log = log;
	}

	public String getSimpleText() {
		return simpleText;
	}

	public void setSimpleText(String simpleText) {
		this.simpleText = simpleText;
	}

	public String getDetailText() {
		return detailText;
	}

	public void setDetailText(String detailText) {
		this.detailText = detailText;
	}

	@Override
	public String toString() {
		return "ExceptionMessage [name=" + name + ", log=" + log + ", simpleText=" + simpleText + ", detailText="
				+ detailText + "]";
	}

	
	
	
	
}
